home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / video / v86asm.s < prev    next >
Encoding:
Text File  |  1995-05-03  |  846 b   |  31 lines

  1. /
  2. / Copyright (C) 1990-1992 Michael Davidson.
  3. / All rights reserved.
  4. /
  5. / Permission to use, copy, modify, and distribute this software
  6. / and its documentation for any purpose and without fee is hereby
  7. / granted, provided that the above copyright notice appear in all
  8. / copies and that both that copyright notice and this permission
  9. / notice appear in supporting documentation.
  10. /
  11. / This software is provided "as is" without express or implied warranty.
  12. /
  13.     .text
  14.  
  15.     .globl     EnterV86Mode
  16.  
  17. EnterV86Mode:
  18.     push    %ebp        / save frame pointer
  19.     movl    %esp, %ebp    / mark stack
  20.     iret            / enter V86 mode through TSS
  21.     cmp    %esp, %ebp    / check for error code on stack
  22.     jne    err
  23.     xor    %eax, %eax    / clear return value
  24.     pop    %ebp        / restore frame pointer
  25.     ret
  26.  
  27. err:    pop    %eax        / get error code
  28.     mov    %ebp, %esp    / restore stack pointer
  29.     pop    %ebp        / restore frame pointer
  30.     ret
  31.